package com.asset.dispoal.business.reportAnalysis;

import com.asset.dispoal.business.reportAnalysis.api.ReportAnalysisService;
import com.asset.dispoal.business.reportAnalysis.dto.AnalysisResultResponse;
import com.asset.dispoal.business.reportAnalysis.dto.HomeResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tech.mhuang.pacebox.springboot.core.controller.BaseController;
import tech.mhuang.pacebox.springboot.protocol.Result;

/**
 * @description:
 * @author: yf
 * @date: 2022-09-20 16:27:41
 */
@Slf4j
@RestController
@RequestMapping("business/analysis")
@Api(value = "报表分析", tags = "报表分析")
public class ReportAnalysisController extends BaseController {

    @Autowired
    private ReportAnalysisService reportAnalysisService;

    @GetMapping("getAgreeNumInfos")
    @ApiOperation(value = "数据周报表合同接口", notes = "数据周报表合同接口")
    public Result<AnalysisResultResponse> getAnalysisResult() {
        AnalysisResultResponse result = reportAnalysisService.getAnalysisDate();
        return Result.ok(result);
    }

    @GetMapping("/getHomeInfo")
    @ApiOperation(value = "首页接口", notes = "首页接口")
    public Result<HomeResponse> getHomeInfo() {
        return Result.ok(reportAnalysisService.getHomeInfo());
    }
}
